CMAKE_MINIMUM_REQUIRED (VERSION 3.10)
SET ( RBDL_URDF_TESTS_VERSION_MAJOR 1 )
SET ( RBDL_URDF_TESTS_VERSION_MINOR 0 )
SET ( RBDL_URDF_TESTS_VERSION_PATCH 0 )
SET(CMAKE_CXX_STANDARD 17)

SET ( RBDL_URDF_TESTS_VERSION 
	${RBDL_URDF_TESTS_VERSION_MAJOR}.${RBDL_URDF_TESTS_VERSION_MINOR}.${RBDL_URDF_TESTS_VERSION_PATCH}
)

PROJECT (RBDL_URDF_TESTS VERSION ${RBDL_URDF_TESTS_VERSION})
FIND_PACKAGE(Catch2 REQUIRED)
INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}/include
                     ${CMAKE_CURRENT_SOURCE_DIR}/../thirdparty/urdfparser/include  
                     ${CMAKE_SOURCE_DIR}/tests
                     ../)
SET ( URDF_TESTS_SRCS
  testURDF.cc
  ../urdfreader.cc
  ../urdfreader.h
  )
IF ( ${CMAKE_VERSION} VERSION_LESS 3.12.0 )
  ADD_DEFINITIONS (-DRBDL_URDFREADER_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}/..")
ELSE( ${CMAKE_VERSION} VERSION_LESS 3.12.0 )
  ADD_COMPILE_DEFINITIONS (RBDL_URDFREADER_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}/..")
ENDIF( ${CMAKE_VERSION} VERSION_LESS 3.12.0 )


ADD_EXECUTABLE ( rbdl_urdf_tests ${URDF_TESTS_SRCS} )

SET (RBDL_LIBRARY rbdl)
SET (RBDL_URDFREADER_LIBRARY rbdl_urdfreader)
TARGET_LINK_LIBRARIES(rbdl_urdf_tests
  ${RBDL_LIBRARY}
  ${RBDL_URDFREADER_LIBRARY}
  )
# OPTION (RUN_AUTOMATIC_TESTS "Perform automatic tests after compilation?" OFF)
# IF (RUN_AUTOMATIC_TESTS)
  
